﻿using System.Data;

namespace AgileNYCWebService.Manager.Data.Table
{
	public class Users : UserDetails
	{
		public Users()
			: this(null)
		{
		}

		public Users(DataRow row)
			: base(row)
		{
			if (row != null)
			{
				if (row.Table.Columns.Contains("Email"))
					Email = row["Email"].GetString(string.Empty);
				if (row.Table.Columns.Contains("Password"))
					Password = row["Password"].GetString(string.Empty);
				if (row.Table.Columns.Contains("SocialType"))
					SocialType = row["SocialType"].GetInteger(-1);
				if (row.Table.Columns.Contains("IsCheck"))
					IsCheck = row["IsCheck"].GetBoolean(false);
				if (row.Table.Columns.Contains("DeviceOs"))
					DeviceOs = row["DeviceOs"].GetInteger(-1);
				if (row.Table.Columns.Contains("DeviceId"))
					DeviceId = row["DeviceId"].GetString(string.Empty);
				if (row.Table.Columns.Contains("MobileWorkingSystem"))
					MobileWorkingSystem = row["MobileWorkingSystem"].GetInteger(-1);
                if (row.Table.Columns.Contains("Badge"))
                    Badge = row["Badge"].GetInteger(1);
			}
		}

		public string Email { get; set; }
		public string Password { get; set; }
		public int SocialType { get; set; }
		public bool IsCheck { get; set; }
		public int DeviceOs { get; set; }
		public string DeviceId { get; set; }
		public int MobileWorkingSystem { get; set; }

        public int Badge { get; set; }
	}
}